package com.hoshiibuy.global.entity.param;

import com.hoshiibuy.global.entity.SysRelationshipsAttr;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.hoshiibuy.common.query.CommonParam;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.time.LocalDateTime;
import java.io.Serializable;

/**
 * <p>
 * 查询关系属性表参数
 * </p>
 *
 * @author campchen
 * @since 2019-04-27
 */
@Data
@ApiModel(value = "查询关系属性表", description = "查询关系属性表")
public class SysRelationshipsAttrQueryParam extends CommonParam {

    /**
     * 主键ID
     */
    @ApiModelProperty(value = "主键ID")
    private Long id;

    /**
     * 关系id
     */
    @ApiModelProperty(value = "关系id")
    private Long rid;

    /**
     * 属性id
     */
    @ApiModelProperty(value = "属性id")
    private Long attrId;

    /**
     * 是否可用0-不可用 1-可用
     */
    @ApiModelProperty(value = "是否可用0-不可用 1-可用 系统自动传递1",example = "1")
    private Integer enabled;

    public QueryWrapper<SysRelationshipsAttr> getQueryWrapper() {
        QueryWrapper<SysRelationshipsAttr> queryWrapper = new QueryWrapper<SysRelationshipsAttr>();
        queryWrapper.eq(this.id != null, "id", this.id);
        queryWrapper.eq(this.rid != null, "rid", this.rid);
        queryWrapper.eq(this.attrId != null, "attr_id", this.attrId);
        queryWrapper.eq(this.enabled != null, "enabled", this.enabled);
        return queryWrapper;
    }
}
